package com.yc.sole.erp.request;

import com.yc.sole.common.enums.CommonState;
import com.yc.sole.framework.validate.SaveGroup;
import com.yc.sole.framework.validate.UpdateGroup;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 客户表 Request对象
 *
 * @author yizuomin
 * @date 2023-05-07
 **/
@Data
public class CustomerReq implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    @NotNull(groups = {UpdateGroup.class})
    private Long id;
    /**
     * 客户名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    @NotBlank(groups = {SaveGroup.class, UpdateGroup.class})
    private String customerName;
    /**
     * 联系人名称
     */
    @Length(max = 50, groups = {SaveGroup.class, UpdateGroup.class})
    private String contacts;
    /**
     * 手机号
     */
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确", groups = {SaveGroup.class, UpdateGroup.class})
    private String phoneNum;
    /**
     * 邮箱
     */
    @Email(groups = {SaveGroup.class, UpdateGroup.class})
    private String email;
    /**
     * 传真
     */
    private String fax;
    /**
     * 地址
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String address;
    /**
     * 应收款
     */
    private BigDecimal receivables;
    /**
     * 已收款
     */
    private BigDecimal receivedPayment;
    /**
     * 状态 0禁用 1可用
     */
    @NotNull(groups = {SaveGroup.class, UpdateGroup.class})
    private CommonState state;
    /**
     * 备注
     */
    @Length(max = 255, groups = {SaveGroup.class, UpdateGroup.class})
    private String remark;
}
